{% for post in posts %}
<div class="article-content">
    <div class="row">
        <div class="col-lg-12">
            <h3><a class="entry-title" href="{{ url_for('.post',id=post.id) }}">
                    {{ post.title }}
                </a></h3>
        </div>
        <div class="col-lg-12">
            <div class="below-entry-meta">
                <span class="post-datetime"><span class="glyphicon glyphicon-calendar"></span>
                    {{ moment(post.timestamp).format('LL') }}
                </span>

                <a href="{{ url_for('.user',username=post.author.username) }}"><span class="post-user"><span
                            class="glyphicon glyphicon-user"></span>
                        {{ post.author.username }}
                    </span></a>
                {% if post.post_type.name %}
                <a href="{{ url_for('.posttype',id=post.post_type.id) }}"><span class="post-datetime"><span
                            class="glyphicon glyphicon-filter"></span>
                        {{ post.post_type.name }}
                    </span></a>
                {% endif %}
                {% if current_user.is_administrator() or current_user==post.author %}
                <a onclick="return confirm('确定要删除吗？')" href="{{ url_for('.delete_post',id=post.id) }}"><span
                        class="post-user"><span class="glyphicon glyphicon-trash"></span>
                    </span></a>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            {% if post.content_text %}
            {{ post.content_text }}
            {% else %}
            {{ post.content }}
            {% endif %}
        </div>
    </div>
</div>
{% endfor %}